package text;

import org.junit.Test;

import java.util.function.Supplier;

public class texts {
    @Test
    public void text(){
        Supplier<Employee>su=new Supplier<Employee>() {
            @Override
            public Employee get() {
                return new Employee();
            }
        };
        System.out.print(su.get());
        System.out.print("**************");
        Supplier<Employee>su1=()->new Employee();
        Employee e1=su1.get();
        System.out.print(e1.hashCode());

        System.out.print("************");
        Supplier<Employee>su2=Employee::new;
        Employee e2=su2.get();
        System.out.println(e2.hashCode());
        System.out.println(e1==e2);
        System.out.println(e1.equals(e2));
    }
    @Test
    public void text1() {
            MyInterface<Integer,String,Double,Employee>mi=new MyInterface<Integer, String, Double, Employee>() {
                @Override
                public Employee get(Integer integer, String s, Double aDouble) {
                    return new Employee(integer,s,aDouble);
                }
            };
        System.out.println(mi.get(1000,"王五",150.5));
    }
}
